package org.mc.sbd.redis.infrastructure.dao;

import org.mc.sbd.redis.infrastructure.po.RedisToken;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class RedisTokenCacheDao {
    @CachePut(cacheNames = "redis_token", key = "#token.id")
    public RedisToken save(RedisToken token) {
        return token;
    }

    @Cacheable(cacheNames = "redis_token", key = "#id", unless = "#result == null")
    public RedisToken findById(Long id) {
        return null;
    }

    @CacheEvict(cacheNames = "redis_token", key = "#id")
    public void deleteById(Long id) {
    }
}
